import { RouteRecordRaw } from "vue-router";
import { errorRouters } from "@/router/routers/error.ts";
import { asideRouters } from "@/router/routers/aside.ts";
import { loginRouters } from "@/router/routers/login.ts";
import { testRouters } from "@/router/routers/test.ts";

export const routes: Array<RouteRecordRaw> = [
  {
    path: "/BasicLayout",
    name: "根布局",
    component: () => import("@/layout/BasicLayout.vue"),
    redirect: "/404",
    children: [
      {
        path: "/",
        redirect: () => {
          return { name: "testLogin" };
        },
      },
      // 侧边栏菜单路由
      ...asideRouters,
    ],
  },
  {
    path: "/LoginLayout",
    name: "登录页布局",
    component: () => import("@/layout/LoginLayout.vue"),
    redirect: "/404",
    children: [
      // 登录相关路由
      ...loginRouters,
    ],
  },
  // 测试相关路由
  ...testRouters,
  // 错误相关路由
  ...errorRouters,
  // 重定向
  {
    path: "/:path(.*)",
    redirect: "/404",
  },
];
